#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
using namespace std;

int main() {
    int n;
    cin >> n;
    string num;
    int tmp = n;
    while (tmp)
    {
        int val = tmp % 10;
        tmp /= 10;
        num += (val + '0');
    }
    int ret = 0;
    for (int i = num.size() - 1; i >= 0; i--)
    {
        if ((num[i] - '0') % 2 == 1)
        {
            ret = ret * 10 + 1;
        }
        else {
            ret *= 10;
        }
    }
    cout << ret << endl;
    return 0;
}
#include <iostream>
#include <type_traits>
using namespace std;
//#include <stdio.h>
#include <vector>
int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> v(n + 1, vector<int>(m + 1, 0));
    for (int i = 1; i <= n; i++)
    {
        int count = 0;
        for (int j = 1; j <= m; j++)
        {
            scanf("%d", &v[i][j]);
            count += v[i][j];
            //cout<<v[i][j]<<" ";
        }
        v[i][0] = count;
        //cout<<v[i][0];
        //cout<<endl;
    }
    for (int i = 1; i <= n; i++)
    {
        int count = 0;
        for (int j = 1; j <= m; j++)
        {
            count += v[j][i];
        }
        v[0][i] = count;
    }
    for (int i = 1; i <= n; i++)
    {
        for (int j = 1; j <= m; j++)
        {
            printf("%d ", v[i][0] + v[0][j] - v[i][j]);
        }
        printf("\n");
    }
    return 0;
}